﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="jquery-1.8.0.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            //$("#div > p").click(function () {
            //    alert($(this).html());
            //});

            $("#div p").click(function () {
                alert($(this).html());
            });
        });
    </script>
</head>
<body>
    <div id="div">
        div1
        <p>
            p1
        </p>
           <p>
            p2
        </p>
        <div>
            div2
            <p>
                p3
            </p>
        </div>
    </div>
</body>
</html>
